﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace UFODefense
{
    public class Definitions
    {
        private Viewport m_viewPort;

        #region Game
        public const int UFO_SPAWN_INTERVAL = 1000;
        #endregion

        #region Screen
        public static float GROUND_Y;
        public const float SCREEN_MIN_Y = 0;
        public const float SCREEN_MIN_X = 0;
        public static float SCREEN_MAX_Y;
        public static float SCREEN_MAX_X;
        #endregion

        #region Gun
        public static float GUN_X;
        public static float GUN_Y;
        public static float GUN_TIP_Y;
        #endregion

        #region UFO
        public const int UFO_MIN_SPEED = 1;
        public const int UFO_MAX_SPEED = 5;
        public const float UFO_SPEED_FACTOR = 3;
        public const int UFO_WIDTH = 50;
        public const int UFO_HEIGHT = 50;
        #endregion

        #region LaserGun
        //milliseconds
        public const int GUN_COOLDOWN = 1500;
        #endregion

        #region Laser
        //milliseconds
        public const int LASER_LIFETIME = 300;
        public static float FROM_GUN_TO_TOP;
        public static float FROM_GUN_TO_SIDE;
        #endregion

        #region MissilePad
        public const Keys KEY_LEFT = Keys.A;
        public const Keys KEY_RIGHT = Keys.D;
        public const Keys KEY_FIRE = Keys.Space;
        public const float PAD_SPEED = 300.0f;
        //milliseconds
        public const int MISSILE_COOLDOWN = 3000;
        #endregion

        #region Missile
        public const float MISSILE_BASE_SPEED = 5;
        public const float MISSILE_BIG_FLAME_TIME = 1.0f;
        public const float STRAIGHT_ANGLE_IN_RADIANS = 1.57079633f;
        #endregion

        #region Explosion
        //milliseconds
        public const int EXPLOSION_LIFETIME = 1000;
        public const int EXPLOSION_FRAMES = 10;
        #endregion

        public Definitions(Viewport vp)
        {
            m_viewPort = vp;
            SCREEN_MAX_Y = m_viewPort.Height;
            SCREEN_MAX_X = m_viewPort.Width;
            GROUND_Y = (m_viewPort.Height - m_viewPort.Height / 10);
            GUN_X = (m_viewPort.Width / 2);
            GUN_Y = GROUND_Y;
            GUN_TIP_Y = GUN_Y;

            FROM_GUN_TO_TOP = m_viewPort.Height - (m_viewPort.Height - GUN_Y);
            FROM_GUN_TO_SIDE = m_viewPort.Width / 2;
            
        } 
    }
}
